package com.lmabbe.common.datasources.core;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @author lmabbe
 */
public interface LmabbeMapper<T> extends BaseMapper<T> {

    /**
     * 创建查询的wrapper
     *
     * @return
     */
    default LambdaQueryWrapper<T> createQueryWrapper() {
        return new LambdaQueryWrapper<>();
    }


    /**
     * 创建忽略dataScope的Wrapper
     * @return
     */
    default LmabbeWrapper<T> createIgnoreDataScopeWrapper() {
        LmabbeWrapper<T> lmabbeWrapper = new LmabbeWrapper<>();
        lmabbeWrapper.setIgnoreDataScope(true);
        return lmabbeWrapper;
    }
}
